#ifndef CONTACT_CONTACTGROUPCONTACT_H
#define CONTACT_CONTACTGROUPCONTACT_H

#include "contactabstractcontact.h"


#include <QPointer>
#include <QMap>


namespace Contact {

class GroupContact : public AbstractContact
{
    Q_OBJECT

    friend class Manager;

public:
    explicit GroupContact(qint64 id, QObject *parent = 0);
    virtual ~GroupContact();

public:
    typedef QMap<qint64, QPointer<Account::Buddy> > PartnerMap;

private:
    qint64 m_id;
    PartnerMap m_partnerMap;

    QString m_displayName;
    QString m_messageStatus;
    qint64 m_lastContactTime;

private slots:
    void onDataChanged(Account::Member *member);

public:
    AbstractContact::Type type() const;
    virtual int id() const;


public:
    const PartnerMap &partnerMap() const;

public:
    bool accept(Account::Buddy *partner);
    bool reject(Account::Buddy *partner);
    bool isAccepted(qint64 id) const;
};

} // namespace Contact

#endif // CONTACT_CONTACTGROUPCONTACT_H
